import request from '@/config/axios'

export interface ProductionTaskOrderVO {
  creatorName: string
  workTaskNumber: string
  productNumber: string
  productName: string
  productStandard: string
  productDrawingNumber: string
  orderQuantity: number
  serialNumber: string
  partNumber: string
  partName: string
  partDrawingNumber: string
  partSpecification: string
  material: string
  specification: string
  netSizeLength: object
  netSizeWidth: object
  cuttingSizeLength: object
  cuttingSizeWidth: object
  plannedQuantity: number
  processName: string
  typeOfWork: string
  cuttingType: string
  isMachine: boolean
  machiningProcess: string
  productionTeam: string
  deviceName: string
  deviceCode: string
  operator: string
  planStartDate: Date
  planEndDate: Date
  warehousePosition: string
  productiveTaskStatus: number
  basicDosage: number
  internalWork: boolean
  outsourcing: boolean
  outsidePurchase: boolean
  taskNumber: number
}

// 查询生产管理-工单管理-班组生产工单列表
export const getProductionTaskOrderPage = async (params) => {
  return await request.get({ url: `/produce/production-task-order/teams/page`, params })
}

// 查询生产管理-工单管理-班组生产工单详情
export const getProductionTaskOrder = async (id: number) => {
  return await request.get({ url: `/produce/production-task-order/get?id=` + id })
}

// 修改生产管理-工单管理-班组生产工单
export const updateProductionTaskOrder = async (data: ProductionTaskOrderVO) => {
  return await request.put({ url: `/produce/production-task-order/teams/update`, data })
}

// 导出生产管理-工单管理-班组生产工单 Excel
export const exportProductionTaskOrder = async (data) => {
  return await request.download({ url: `/produce/production-task-order/teams/export-excel`, data })
}

// 退回生产管理-工单管理-班组生产工单 Excel
export const returnProductionTaskOrder = async (id: number) => {
  return await request.put({ url: `/produce/production-task-order/teams/return?id=` + id })
}